import request from '@/utils/request'
import qs from 'querystring'
export function loginByUsername(username, password) {
    const data =qs.stringify({
        empName:username,
        pwd:password
    }) 
    return request({
        url: '/empLogin',
        method: 'post',
        data
    })
}

export function logout() {
    return request({
        url: '/login/logout',
        method: 'post'
    })
}

export function getProfit() {
    return request({
        url: '/getProfit',
        method: 'post'
    })
}


export function getUserInfo() {
    return Promise.resolve({
        data:{
            roles:['admin'],
            name:"管理员",
            avatar:'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif'
        }
    })
}

